<?php
/**
 * Created by PhpStorm.
 * User: 何婷婷
 * Date: 2016/11/8
 * Time: 17:15
 */

namespace App\Core;


class View
{
    static function showMsg($msg, $data = array())
    {
        echo $msg;
        echo "<br>";
        if (empty($data)) {
            return null;
        } else {
            echo "用户信息列表：";
          var_dump($data);
        }

        exit();
    }

    /*static function showLoginMsg($msg) {
        echo $msg;
        exit();
    }*/

    static function showPage($controller, $tpl)
    {
        $file_path = APP_PATH . DS . 'templates' . DS . strtolower($controller) . DS . $tpl . '.tpl.php';
        if (realpath($file_path))  //realpath — 返回规范化的绝对路径名
        {
            include_once($file_path);
            exit();
        } else {
            View::showMsg($file_path . ' isn\'t exist!');
        }
    }

}